import request from '../utils/request'

export function fetchAllUsers(){
    return request({
        url:'/api/UserInfo/GetUserInfoUnion',
        method:'get'
    })
}

export function deleteUser(para){
    return request({
        url:'/api/User/DeleteUser',
        method:'delete',
        params:para
    })
}

export function getUserByName(para){
    return request({
        url:'api/UserInfo/GetUserInfoByRealName',
        method:'get',
        params:para
    })
}

export function addUser(para){
    return request({
        url:'api/User/AddUser',
        method:'post',
        data:para
    })
}

export function updateUserInfo(para) {
    return request({
        url:'api/UserInfo/UpdateUserInfo',
        method:'put',
        data:para
    })
}

export function updateUserRoles(para) {
        return request({
            url:'/api/User/SetUserRole',
            method:'post',
            params:para
        })
}